import request from '@/utils/request';

export function useAuthApi() {
  return {
    captcha: () => {
      return request({
        url: '/auth/captcha',
        method: 'get',
      });
    },

    login: (params: object, data: object) => {
      return request({
        url: '/auth/token',
        method: 'post',
        headers: {
          'Content-Type': 'multipart/form-data',
        },
        params,
        data,
      });
    },

    permissions: (usre_id: string) => {
      return request({
        url: `/users/${usre_id}/permissions`,
        method: 'get',
      });
    },
  };
}
